experiment(debug): set the language to pascal to get better gdb syntax support#1676
Draft
experiment(debug): set the language to pascal to get better gdb syntax support#1676
Conversation
…control The LLVM C API (LLVMDIBuilderCreateCompileUnit) does not expose the NameTableKind parameter, which controls .debug_names accelerator table emission. This adds a C++ wrapper that calls DIBuilder::createCompileUnit directly, allowing us to set NameTableKind::None (matching clang's default) or NameTableKind::Default for opt-in .debug_names emission. The Rust side exposes a safe `create_debug_info()` function that hides all raw pointer handling and transmutes behind a friendly inkwell-typed API.
…ility When compiling multiple ST files with DWARF 5 debug info, each compilation unit gets its own .debug_names table. The linker (lld) concatenates them, but GDB cannot parse concatenated tables and warns: "Section .debug_names length X does not match section length Y" This matches clang's default behavior of setting nameTableKind: None on DICompileUnit. A new --gpubnames CLI flag allows opting back into .debug_names emission when needed (e.g. for lldb-only workflows).
All debug test snapshots now include nameTableKind: None in the DICompileUnit metadata, reflecting the new default behavior.
…t when lowering output assignment (#1657) Co-authored-by: Ghaith Hachem <ghaith.hachem@bachmann.info>
Pascal83 is semantically closer to IEC 61131-3 Structured Text than C, giving us case-insensitive symbol lookup and better type display in GDB as a first step toward proper ST debugging support. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Build Artifacts🐧 Linux
From workflow run 🪟 Windows
From workflow run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If we set the gdb language to pascal, it might instruct editors to respect array bounds.
it might also make expressions easier since a lot of the syntax is similar.